<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="js/jquery-1.4.4.js"></script>
<script type="text/javascript" src="js/jquery.jeditable.js"></script>
<script type="text/javascript" src="js/jquery.jeditable.date.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.8.custom.min.js"></script>
<script type="text/javascript" src="js/jquery.jeditable.datepicker.js"></script>
<script type="text/javascript">
	$(function() {
		//获取url传过来的员工id参数;
		var id = document.location.search;
		id = id.substring(id.indexOf('=') + 1, id.length);
		var params={'id':id};
	//获取员工各项数据
		$.getJSON('employee-info!list', params, function(data) {
			//获取员工基本信息数据
			var emptrHTML="";
			var emp=data.employee;
			emptrHTML+="<tr><td> 工号：</td><td> <label id='job_no' class='employee-info-div'>"+emp.job_no+"</label></td> </tr>";
			emptrHTML+="<tr><td> 姓名：</td><td> <label  id='name' class='employee-info-div'>"+emp.name+"</label></td></tr>";
			emptrHTML+="<tr><td> 性别：</td><td > <label  id='gender' class='employee-info-div'>"+emp.gender+"</label></td></tr>";
			emptrHTML+="<tr><td> 联系电话：</td><td> <label id='mobile'class='employee-info-div'>"+emp.mobile+"</label></td></tr>";
			emptrHTML+="<tr><td> 身份证：</td><td> <label id='cert_number' class='employee-info-div'>"+emp.cert_number+"</label></td></tr>";
			emptrHTML+="<tr><td> 电子邮件：</td><td> <label id='email' class='employee-info-div'>"+emp.email+"</label></td></tr>";
			emptrHTML+="<tr><td> 最高学历：</td><td> <label id='top_education'  class='employee-info-div'>"+emp.top_education+"</label></td></tr>";
			emptrHTML+="<tr><td> 当前状态：</td><td> <label id='status'  class='employee-info-div'>"+emp.status+"</label></td></tr>";
			$('#employee-info').append(emptrHTML);
		$(".employee-info-div").editable('employee!input?id='+id, {
			indicator : "正在处理中",
			id:'elementid',
			name:'elementvalue',
			cancel : '取消',
			submit : '提交'
		});
		//获取员工学历教育信息数据
			var edutrHTML="";
			var edu=data.educationList;
			$.each(edu,function(i,education){
				edutrHTML+="<tr><td>"+i+"</td>";
				edutrHTML+="<td> <label id='school_name-"+education.id+"' class='employee-edu-div'>"+education.school_name+"</label> </td>";
				edutrHTML+="<td> <label id='entered_on-"+education.id+"' class='employee-edu-div-date'>"+education.entered_on+"</label> </td>";
				edutrHTML+="<td> <label id='graduated_on-"+education.id+"'  class='employee-edu-div-date'>"+education.graduated_on+"</label> </td></tr>";
					});
			$('#employee-edu').append(edutrHTML);
		$(".employee-edu-div-date").editable('education-bg!input', {
			type:'date',
			indicator : '正在处理中',
			id:'elementid',//此项参数中包含修改的字段和该字段值所对应的id
			name:'elementvalue',
			cancle : '取消',
			submit : '提交',
			onblur:'cancle'
		});
		//获取员工IT技能信息数据
		var istrHTML="";
		var itskill=data.itSkilList;
		$.each(itskill,function(i,is){
			istrHTML+="<tr><td>"+i+"</td>";
			istrHTML+="<td> <label id='label-"+is.id+"' class='employee-is-div'>"+is.label+"</label> </td>";
			istrHTML+="<td> <label id='usage_experience-"+is.id+"' class='employee-is-div'>"+is.usage_experience+"</label> </td>";
			istrHTML+="<td> <label id='competency_level-"+is.id+"' class='employee-is-div'>"+is.competency_level+"</label> </td></tr>";
			});
		$('#employee-is').append(istrHTML);
		$('.employee-is-div').editable('it-skill!input',{
			indicator:'正在处理中',
			id:'elementid',
			name:'elementvalue',
			cancle:'取消',
			submit : '提交',
			onblur:'cancle'
		});
		//获取员工培训信息数据
		var tbgHTML="";
		var trainbackground=data.trainingBg;
		$.each(trainbackground,function(i,tbg){
			tbgHTML+="<tr> <td>"+i+"</td>";
			tbgHTML+="<td> <label id='institution_name-"+tbg.id+"' class='employee-tbg-div'>"+tbg.institution_name+"</label> </td>";
			tbgHTML+="<td> <label > 数据库无此字段</label> </td>";
			tbgHTML+="<td> <label > 数据库无此字段</label> </td></tr>";
			});
		$('#employee-tbg').append(tbgHTML);
		$('.employee-tbg-div').editable('training-bg!input',{
			indicator:'正在处理中',
			id:'elementid',
			name:'elementvalue',
			cancle:'取消',
			submit : '提交',
			onblur:'cancle'
		});
		//获取员工语言技能信息数据
		var lsHTML="";
		var languageskill=data.languageList;
		$.each(languageskill,function (i,ls){
			lsHTML+="<tr> <td>"+i+"</td>";
			lsHTML+="<td> <label id='label-"+ls.id+"' class='employee-ls-div'>"+ls.label+" <label> </td>";
			lsHTML+="<td> <label id='competency_level-"+ls.id+"' class='employee-ls-div'>"+ls.competency_level+" <label> </td> </tr>";
			});
		$('#employee-ls').append(lsHTML);
		$('.employee-ls-div').editable('language-skill!input',{
			indicator:'正在处理中',
			id:'elementid',
			name:'elementvalue',
			cancle:'取消',
			submit : '提交',
			onblur:'cancle'
		});
		
		});
	})
</script>
<title>员工信息详情</title>
</head>
<body>
<div><label>员工基本信息</label>
<table border="1" cellspacing="0" id="employee-info">
</table>
</div>
<br>
<div><label>员工教育信息</label>
<table border="1" cellspacing="0" id="employee-edu">
	<tr>
		<th>NO</th>
		<th>学校名称</th>
		<th>入学时间</th>
		<th>毕业时间</th>
	</tr>
</table>
</div>
<br>
<div>
<label>修改员工IT技能信息</label>
<table border="1" cellspacing="0" id="employee-is">
	<tr>
		<th>NO</th>
		<th>技术名称</th>
		<th>使用时间</th>
		<th>等级</th>
	</tr>
</table>
</div>
<br>
<div>
<label>修改员工培训信息</label>
<table border="1" cellspacing="0" id="employee-tbg">
	<tr>
		<th>NO</th>
		<th>培训学校名称</th>
		<th>培训技能</th>
		<th>培训时长</th>
	</tr>
</table>
</div>
<br>
<div>
<label>修改员工语言信息</label>
<table border="1" cellspacing="0" id="employee-ls">
	<tr>
		<th>NO</th>
		<th>语言名称</th>
		<th>等级</th>
	</tr>
</table>
</div>
<div></div>
<div></div>
<div></div>
</body>
</html>